import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
	{
		path: "/",
		name: "login",
		component: HomeView,
	},
	{
		path: "/home",
		// route level code-splitting
		// this generates a separate chunk (about.[hash].js) for this route
		// which is lazy-loaded when the route is visited.
		component: () => import("../views/HomeView.vue"),
		children: [
			{ path: "", component: () => import("../views/AudioCourseView.vue") },
			{
				path: "AudioCourse",
				name: "AudioCourse",
				component: () => import("../views/AudioCourseView.vue"),
			},
			{
				path: "EditAudio",
				name: "EditAudio",
				component: () => import("../views/EditAudioPage.vue"),
			},
		],
	},
];

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes,
});

export default router;
